package com.xci.edu.core.controller;

import com.github.lvyanyang.upload.service.KindEditorService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/kindeditor")
public class KindEditorFileController {
    @Resource private KindEditorService kindEditorService;

    @ResponseBody
    @PostMapping("/upload")
    public Object upload(HttpServletRequest request) {
        return kindEditorService.upload(request);
    }

    @ResponseBody
    @GetMapping("/manager")
    public Object manager(HttpServletRequest request) {
        return kindEditorService.manager(request);
    }
}
